<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of generarReporteCajaSuccess
 *
 * @author Marcelo
 */

?>
<?php use_stylesheet('/sfPropelPlugin/css/global.css') ?>
<?php use_stylesheet('/sfPropelPlugin/css/default.css') ?>


<?php if($cierre_caja):?>
<div id="sf_admin_container">
    <h2>Reporte de Estado de Caja</h2>
    <fieldset><h2>Fecha del Reporte: <?php echo $Fechas?> </h2></fieldset>
<table>
    <thead>
    <th>ITEM</th>
    <th>CATEGORIA</th>
    <th>INGRESO</th>
    <th>EGRESO</th>
    </thead>
    <tbody>
        <?php $e = 1;$total=0;$totalegresos=0;foreach($cierre_caja as $caja):?>
        <tr>
        <td><?php echo $e++ ?></td>
        <td><?php echo $caja['categorias']?></td>
        <td  align="right" ><?php echo number_format($caja['Total_Ingreso'],0,'','.').' Gs'?></td>
        <td  align="right"><?php echo number_format($caja['Total_Egreso'],0,'','.').' Gs'?></td>
        </tr>
        <?php $total += $caja['Total_Ingreso'];$totalegresos +=$caja['Total_Egreso'];   endforeach; ?>
    </tbody>
    <tfoot>
        <th></th>
        <th>Total Saldo: <?php    echo number_format($total-$totalegresos,0,'','.').' Gs'?></th>
        <th>Total Ingresos: <?php echo number_format($total,0,'','.').' Gs'?></th>
        <th style="color: red">Total Egresos: <?php  echo number_format($totalegresos,0,'','.').' Gs'?></th>
    </tfoot>
</table>
<?php else:?>
<div class="error">No Hay Resultados</div>
    <?php endif;?></div>